package com.mercury.ec.framework.air.core.enums;

import cn.hutool.core.util.ArrayUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 机票渠道枚举
 *
 * @author hesx
 */
@Getter
@AllArgsConstructor
public enum AirChannelEnum {

    CTRIP("ctrip", "携程"),
    YEATRIP("yeatrip","小太阳"),
    QUNAR("qunar","去哪儿"),
    ;

    /**
     * 编码
     */
    private final String code;
    /**
     * 名字
     */
    private final String name;

    public static AirChannelEnum getByCode(String code) {
        return ArrayUtil.firstMatch(o -> o.getCode().equals(code), values());
    }

}
